Avoid a critical
authorMatthias Clasen <mclasen@redhat.com>
Thu, 27 Nov 2014 23:22:52 +0000 (18:22 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 27 Nov 2014 23:24:12 +0000 (18:24 -0500)
gtk_window_get_focus can return NULL, deal with it.

https://bugzilla.gnome.org/show_bug.cgi?id=740812

gtk/gtkpopover.c

index 38214c923907ad186717a1a02a4395f955a7e6b8..83a8111ebc25bbde41532b03f202260c0513981d 100644 (file)
@@ -311,7 +311,7 @@ window_focus_in (GtkWidget  *widget,
 
       focus = gtk_window_get_focus (GTK_WINDOW (widget));
 
-      if (!gtk_widget_is_ancestor (focus, GTK_WIDGET (popover)))
+      if (focus == NULL || !gtk_widget_is_ancestor (focus, GTK_WIDGET (popover)))
         gtk_widget_grab_focus (GTK_WIDGET (popover));
 
       if (priv->grab_notify_blocked)